package com.qd.common.sys.domain.entity.article;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;


/**
 * 内容详情
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class ArticleContentDTO extends BaseQuery {

    @ExcelIgnore
    @JsonIgnore
    private static final String TITLE = "内容详情";
    /**
     * 主键
     */
    @ExcelProperty(value = {TITLE, "文章标识"})
    @NotBlank(message = "文章标识不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "文章标识长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String articleId;
    /**
     * 内容
     */
    @ExcelProperty(value = {TITLE, "内容"})
    private String content;

    @Override
    public void freeData() {
        this.articleId = null;
        this.content = null;
        super.freeData();
    }
}
